package com.cao.meet;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.cao.meet.swipelist.SwipeListActivity;

import study.nababy.recyclerview.first.normal.activity.GridRecycleActivity;
import study.nababy.recyclerview.first.normal.activity.ListRecycleActivity;
import study.nababy.recyclerview.first.normal.activity.PullRecycleActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Intent mIntent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initViews();
    }

    private void initViews() {
        final Button swipelist = (Button) findViewById(R.id.swipelist);
        swipelist.setOnClickListener(this);
        final Button list_recycle = (Button) findViewById(R.id.list_recycle);
        list_recycle.setOnClickListener(this);
        final Button grid_recycle = (Button) findViewById(R.id.grid_recycle);
        grid_recycle.setOnClickListener(this);
        final Button pull_recycle  = (Button) findViewById(R.id.pull_recycle);
        pull_recycle.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //仿QQ侧滑删除
            case R.id.swipelist:
                mIntent = new Intent(getApplicationContext(), SwipeListActivity.class);
                startActivity(mIntent);
                break;
            //RecyclerView，打造ListView效果
            case R.id.list_recycle:
                mIntent = new Intent(getApplicationContext(), ListRecycleActivity.class);
                startActivity(mIntent);
                break;
            //RecyclerView，打造GridView效果
            case R.id.grid_recycle:
                mIntent = new Intent(getApplicationContext(), GridRecycleActivity.class);
                startActivity(mIntent);
                break;
            //RecyclerView，打造瀑布流效果
            case R.id.pull_recycle:
                mIntent = new Intent(getApplicationContext(), PullRecycleActivity.class);
                startActivity(mIntent);
                break;
        }
    }
}
